/**
 * Filename: PopSetAvatar.java
 *
 * @author Firefly
 * @contact postfirefly@163.com
 * @time 2016/3/18 15:08
 */
package com.github.postsanf.yinian.activity.pop;


import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.PopupWindow;

import com.github.postsanf.yinian.R;

public class PopTopay extends PopupWindow {
    public ImageView to_pay_10, to_pay_50, to_pay_close;
    public View mMenuView;

    public PopTopay(Activity context, OnClickListener itemsOnClick, View.OnTouchListener itemsOnTouch) {
        super(context);
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mMenuView = inflater.inflate(R.layout.pop_to_pay, null);
        to_pay_10 = (ImageView) mMenuView.findViewById(R.id.to_pay_10);
        to_pay_50 = (ImageView) mMenuView.findViewById(R.id.to_pay_50);
        to_pay_close = (ImageView) mMenuView.findViewById(R.id.to_pay_close);
        to_pay_close.setOnClickListener(itemsOnClick);
        //设置按钮监听
        to_pay_10.setOnClickListener(itemsOnClick);
        to_pay_50.setOnClickListener(itemsOnClick);
        //设置PopSetAvatar的View
        this.setContentView(mMenuView);
        //设置PopSetAvatar弹出窗体的宽
        this.setWidth(LayoutParams.FILL_PARENT);
        //设置PopSetAvatar弹出窗体的高
        this.setHeight(LayoutParams.MATCH_PARENT);
        //设置PopSetAvatar弹出窗体可点击
        this.setFocusable(true);
        //设置PopSetAvatar弹出窗体动画效果
        this.setAnimationStyle(R.style.AnimBottom);
        //实例化一个ColorDrawable颜色为半透明
        ColorDrawable dw = new ColorDrawable(0x00000000);
        //设置PopSetAvatar弹出窗体的背景
        this.setBackgroundDrawable(dw);
        mMenuView.setOnTouchListener(itemsOnTouch);
    }

}
